package com.yww.leetcode2.array;

/**
 * @author yww
 * @description 80. 删除有序数组中的重复项 II
 * @since 2024/11/19
 */
public class RemoveDuplicates80_06 {
    public int removeDuplicates(int[] nums) {
        // 111 222 333
        int fast = 2, slow = 2;
        while (fast < nums.length) {
            if (nums[fast] == nums[fast - 2]) {
                nums[slow] = nums[fast];
                slow++;
            }
            fast++;
        }
        return slow;
    }
}
